package com.ngkj.zmfptback.sys.service.read;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ngkj.zmfptback.sys.bean.OperationEntity;
import com.ngkj.zmfptback.sys.bean.RoleEntity;
import com.ngkj.zmfptback.sys.bean.UserEntity;

import java.util.List;

/**
 * @author ChenHN
 * @since 2021/12/1 creation
 **/
public interface UserReadService extends IService<UserEntity> {

    /**
     * 获取用户信息通过id
     * @param id
     * @return
     */
    UserEntity getUserByUserId(String id);

    /**
     * 获取用户信息通过username
     * @param username
     * @return
     */
    UserEntity getUserByUsername(String username);

    /**
     * 获取角色list通过userId
     * @param id
     * @return
     */
    List<RoleEntity> getRoleByUserId(Integer id);

    /**
     * 获取操作list通过userId
     * @param id
     * @return
     */
    List<OperationEntity> getOperationsByUserId(Integer id);

    /**
     * 获取用户
     * @param page
     * @param user
     * @param beginTime
     * @param endTime
     * @return
     */
    IPage<UserEntity> getUserList( Page<UserEntity> page, UserEntity user, String beginTime, String endTime);

    /**
     * 获取用户信息
     * @param id
     * @return
     */
    UserEntity getMyUser(String id);

    /**
     * 获取realUserId通过userId
     * @param userId
     * @return
     */
    Long getRealUserIdByUserId(Long userId);

    /**
     * 根据真实信息id获取用户信息
     * @param id
     * @return
     */
    UserEntity getUserInfoByRealId(Long id);
}
